/**
 * 
 */
package gpl.scotlandyard.beans.adapters;

import gpl.scotlandyard.beans.basics.Player;

/**
 * @author norbert
 *
 */
public class SecuredFugitive extends Player {

  private String password;

  /**
   * @param fugitiveName
   * @param fugitivePwd
   */
  public SecuredFugitive(String fugitiveName, String fugitivePwd) {
    super(fugitiveName);
    password = fugitivePwd;
    setFugitive(true);
  }

  /**
   * Tests the password and returns true if equals.
   * @param pwd to test
   * @return true if is the same otherwise false.
   */
  public boolean isValidPassword(String pwd) {
    if (!password.equals(pwd)) {
      return false;
    }
    return true;
  }

  /**
   * @return the password
   */
  public String getPassword() {
    return password;
  }

  /**
   * @param password the password to set
   */
  public void setPassword(String password) {
    this.password = password;
  }

}
